<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%>
<script src="<c:url value='/js/jquery.cookie.js'/>"></script>

<script src="js/selectDesignPatternCategory.js"></script>
<script type="text/javascript">
	$(function() {
		$("#template_list").hide();
		var name = $.cookie('query_name');
		var des = $.cookie('query_des');
		$("#template_name").val(name);
		$("#template_description").val(des);
	});

	function notUseTemplate() {
		var id = $.cookie('projectId');
		window.location.href = "<%=request.getContextPath()%>/aadl/model/edit?projectId="+id; 
	}
</script>
<div class="page-header">
	<h3 style="margin-top: auto">
		选择设计模式组件
	</h3>
	<div class="form-inline">
		<div>
		    <label class="control-label">项目类别</label>
				<select style="width: 200px" id="groupid" name="groupid" class="selector">
					<option value="0"></option>
						<c:choose>
							<c:when test="${!empty groups}">
								<c:forEach items="${groups}" var="list" varStatus="s">
									<option value="${list.id}">${list.name}</option>
								</c:forEach>
							</c:when>
						</c:choose>
					</select>
			<label class="control-label">名称</label>
			    <input type="text" style="margin-left: 10px;" class="input-large" placeholder="设计模式组件名称" id="designPatternCategory_name">
				<label style="margin-left: 50px;">描述信息</label>
				<input type="text" style="margin-left: 10px;" class="input-xlarge" placeholder="设计模式组件描述信息" id="designPatternCategory_description">
				<button type="button" style="margin-left: 10px;width: 100px" class="btn"
				    id="btn_add_div" onclick="queryDesignPatternCategory(1)">
				    <i class="icon-search"></i>&nbsp;开始检索
				</button>
		</div>
		<div style="margin-top: 10px;">
			
		</div>
	</div>
</div>
<div class="row-fluid">
	<div>
		<span id="search_reuslt"></span>
		<table class="table table-hover" id="desingPatternCategoryList" style="width:80%">
			<thead>
				<tr>
					<th width="10%">编号</th>
					<th width="15%">名称</th>
					<th width="15%">创建者</th>
					<th width="40%">描述信息</th>
					<th width="20%">操作</th>
				</tr>
			</thead>
			<tbody>
			</tbody>
			<tfoot>
			</tfoot>
		</table>
	</div>
</div>

<div class="modal hide fade" id="use-designPatternCategory-panel">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal"
            aria-hidden="true">&times;</button>
        <h3>复用设计模式组件</h3>
    </div>
    <div class="modal-body">
        <p>复用设计模式组件将会将组件的所有内容导入到项目中，是否继续?</p>
    </div>
    <div class="modal-footer">
        <button class="btn" data-dismiss="modal" onclick="importDesignPatternComponents(${projectId})">
            <i class="icon-ok"></i>&nbsp;确定
        </button>
        <button class="btn" data-dismiss="modal">
            <i class="icon-remove"></i>&nbsp;取消
        </button>
    </div>
</div>

<!--/span-->